package main

import (
	"encoding/xml"
	"fmt"
	"os"
)

type Servers struct {
	XMLName xml.Name `xml:"servers"`
	Version string `xml:"version,attr"`
	Svs []Server `xml:"server"`
}

type Server struct {
	ServerName string `xml:"serverName"`
	ServerIP string `xml:"serverIP"`
}

func main() {
	v := &Servers{Version:"1.0"}
	v.Svs = append(v.Svs, Server{"Shanghai_VPN", "127.0.0.1"})
	v.Svs = append(v.Svs, Server{"Xi'an_VPN", "128.0.0.1"})
	output, err := xml.MarshalIndent(v, "   ", "    ")
	if err != nil {
		fmt.Printf("error: %v\n", err)
		return;
	}

	os.Stdout.Write([]byte(xml.Header))
	os.Stdout.Write([]byte(output))
}